<template>
	<view>
		<!-- 返回上一页 -->
		<view class="" style="  width: 90%;margin:60rpx auto; height: 100rpx; display: flex; align-items: center; ">
			<image @click="toReturn" style="width: 50rpx; height: 50rpx;" src="../../../static/images/goBack.png">
			</image>
			<span>消费记录</span>
		</view>
		<view class="" style=" width: 90%; margin: auto;  border-radius: 20rpx;">
			<view class="" style=" margin: 20rpx 0; background: #ccc; border-radius: 10rpx;" v-for="(item ,index) in dataname">
				<!-- <p>支付方式：微信支付</p> -->
				<view class="" style="margin-left: 20rpx; padding: 20rpx 0;">
					<p >消费金额：{{item.money}}</p>
					<p >消费信息：{{item.memo}}</p>
				</view>
			
			</view>
		</view>
	</view>
</template>

<script>
	import {getmoneyLog} from '@/http/api.js'
	export default {
		data() {
			return {
				dataname:[],
				userInfo : uni.getStorageSync('userInfo')
			};
		},
		onLoad() {
		this.moneyLog()
		},
		methods:{
			// 消费记录
			moneyLog(){
				let data ={
					"token": this.userInfo.userinfo.token,
				}
				getmoneyLog(data).then((res)=>{
					this.dataname =  res[1].data.data
					console.log(res[1].data.data,"消费记录");
				})
			},
			// 返回上一页
			toReturn() {
				uni.navigateBack();
			},
		}
	}
</script>

<style lang="scss">

</style>
 